From 19e7a2994fe6738c28738b3768b2c665bd7c5b05 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 12 Feb 2013 10:33:42 -0800 Subject: [PATCH] * pre-crt0.c (data_start): Initialize to 1. This ports to compilers that optimize the external declaration 'int x = 0;' as if it were 'int x;' to shrink the executable. --- src/ChangeLog | 6 ++++++ src/pre-crt0.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 40d322450b1..8ae23c1b83a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-02-12 Paul Eggert + + * pre-crt0.c (data_start): Initialize to 1. + This ports to compilers that optimize the external declaration + 'int x = 0;' as if it were 'int x;' to shrink the executable. + 2013-02-11 Paul Eggert Improve AIX port (Bug#13650). diff --git a/src/pre-crt0.c b/src/pre-crt0.c index ea5736eba2a..6b9618c8dc3 100644 --- a/src/pre-crt0.c +++ b/src/pre-crt0.c @@ -4,7 +4,7 @@ that make environ an initialized variable. However, we do need to make sure the label data_start exists anyway. */ -/* Create a label to appear at the beginning of data space. */ - -int data_start = 0; +/* Create a label to appear at the beginning of data space. + Its value is nonzero so that it cannot be put into bss. */ +int data_start = 1; -- 2.30.2